import config from "@/config";
import http from "@/utils/request";

export default {
	tree: {
		url: `${config.API_URL}/department/tree`,
		name: "部门树形列表",
		get: async function (data) {
			return await http.post(this.url, data);
		},
	},
	avaliableTree: {
		url: `${config.API_URL}/department/tree`,
		name: "部门树形列表",
		get: async function () {
			return await http.post(this.url, { action: "ava" });
		},
	},
	add: {
		url: `${config.API_URL}/department/add`,
		name: "新增部门",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	update: {
		url: `${config.API_URL}/department/update`,
		name: "编辑部门",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	remove: {
		url: `${config.API_URL}/department/remove`,
		name: "删除部门",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	batchRemove: {
		url: `${config.API_URL}/department/remove/batch`,
		name: "批量删除部门",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
};
